@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    width: 100%;
}

.card {
    perspective: 1000px;
    height: 400px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    overflow: hidden;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-front {
    background-color: #ffffff;
    box-shadow: 
        15px 15px 30px rgba(0, 0, 0, 0.1),
        -15px -15px 30px rgba(255, 255, 255, 0.8),
        inset 5px 5px 10px rgba(0, 0, 0, 0.05),
        inset -5px -5px 10px rgba(255, 255, 255, 0.5);
}

.card-back {
    background-color: #ffffff;
    transform: rotateY(180deg);
    box-shadow: 
        15px 15px 30px rgba(0, 0, 0, 0.1),
        -15px -15px 30px rgba(255, 255, 255, 0.8),
        inset 5px 5px 10px rgba(0, 0, 0, 0.05),
        inset -5px -5px 10px rgba(255, 255, 255, 0.5);
}

.card-image {
    width: calc(100% + 4rem);
    height: 200px;
    object-fit: cover;
    margin: -2rem -2rem 1rem -2rem;
    border-radius: 20px 20px 0 0;
}

h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
}

p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
}

.excerpt {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.read-more {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 25px;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
    align-self: flex-start;
}

.read-more:hover {
    background-color: #45a049;
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }
}